<template>
  <div class="main_c">
    <div class="card_c big_box good_moring">
      <div class="content">
        <div class="grade">
          <el-icon size="50">
            <Medal class="medal" />
          </el-icon>
        </div>
        <div class="merge">
          <div class="name"><span>Hi</span> Bobby</div>
          <div class="fitting">
            今天也要加油喔 今天也要加油喔 今天也要加油喔
          </div>
        </div>
      </div>
    </div>
    <div class="group">
      <div class="card_c littel_box">
        <div class="content shop_prod">
          <div class="title">累计售出:</div>
          <div class="number">1234354234234<span> 件</span></div>
          <div class="icon">
            <el-icon size="45">
              <Shop />
            </el-icon>
          </div>
        </div>
      </div>
      <div class="card_c littel_box">
        <div class="content consume_star">
          <div class="title">消费之星:</div>
          <div class="pic_box">
            <div class="avatar">
              <img src="../../assets/user_avatar.jpg" alt="" />
            </div>
            <div class="win_icon">
              <img src="../../assets/chibang_win.png" alt="" />
            </div>
          </div>
          <div class="icon">
            <img src="../../assets/comp_win.png" alt="" />
          </div>
        </div>
      </div>
    </div>
    <div class="group">
      <div class="card_c littel_box">
        <div class="content sale_money">
          <div class="data-box">
            <div class="number">10.54 <span>万</span></div>
            <div class="title">今日销售额</div>
          </div>
          <div class="icon">
            <el-icon size="45">
              <Ticket />
            </el-icon>
          </div>
        </div>
      </div>
      <div class="card_c littel_box">
        <div class="content shop_prod">
          <div class="title">今日售出:</div>
          <div class="number">234<span> 件</span></div>
          <div class="icon">
            <el-icon size="45">
              <Histogram />
            </el-icon>
          </div>
        </div>
      </div>
    </div>

    <div class="card_c big_box super_box">
      <div class="content"><Active></Active></div>
    </div>
    <div class="group_two">
      <div class="card_c middle_box week_record">
        <div class="content"><weekRecord></weekRecord></div>
      </div>
      <div class="card_c middle_box visits">
        <div class="content">
          <Visits></Visits>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import weekRecord from "./component/week_record.vue";
import Active from "./component/active.vue";
import Visits from "./component/visits.vue";
</script>
<style lang="scss" scoped>
// 小卡片背景颜色
$card_color: #dedbfe;

.good_moring {
  position: relative;
  min-height: 300px;
  background-color: #8176f1;
  color: #fff;

  &::before {
    content: "";
    background: url("../../assets/decore-left.png");
    background-size: cover;
    width: 25%;
    height: 40%;
    position: absolute;
    left: 0;
    top: 0;
  }
  &::after {
    content: "";
    background: url("../../assets/decore-right.png");
    background-size: cover;
    width: 30%;
    height: 40%;
    position: absolute;
    right: 0;
    top: 0;
  }
  .content {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;

    .grade {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100px;
      height: 100px;
      border-radius: 50%;
      color: #000;
      background-color: #867bf2;
      box-shadow: inset 0px -10px 10px rgba(0, 0, 0, 0.1);
      .medal {
        color: #ffffff;
      }
    }
    .merge {
      height: 35%;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      .name {
        font-weight: 700;
        font-size: 30px;
      }
      .fitting {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        font-size: 12px;
      }
    }
  }
}

.week_record {
  margin-bottom: 10px;
}
.visits {
}
// 售出产品
.shop_prod {
  display: block;
  background-color: $card_color;
  border-radius: 10px;
  .title {
    text-align: start;
    padding: 20px 0 0 20px;
    color: #666;
    font-weight: 700;
    font-size: 20px;
  }
  .number {
    font-size: 20px;
    font-weight: 700;
    color: #666;
    span {
      font-size: 30px;
      color: #4b4b4b;
    }
  }
  .icon {
    text-align: end;
    color: #8176f1;
  }
}
// 消费之星
.consume_star {
  position: relative;
  height: 100%;
  width: 100%;
  background-color: $card_color;
  border-radius: 10px;
  .title {
    text-align: start;
    padding: 20px 0 0 20px;
    color: #666;
    font-weight: 700;
    font-size: 20px;
  }
  .pic_box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    .avatar {
      img {
        position: absolute;
        top: 12px;
        left: calc(50% - 40px);
        width: 80px;
        height: 80px;
        border-radius: 50%;
      }
    }
    .win_icon {
      // width: 5%;
      // height: 5%;
      img {
        position: absolute;
        bottom: 16px;
        right: calc(50% - 9%);
        width: 18%;
      }
    }
  }
  .icon {
    position: absolute;
    right: 0;
    bottom: 0;
    img {
      width: 40px;
    }
  }
}
// 销售额
.sale_money {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
  background-color: $card_color;
  .data-box {
    padding-left: 20px;
    .number {
      text-align: end;
      font-size: 30px;
      line-height: normal;
      span {
        font-weight: 700;
      }
    }
    .title {
      text-align: start;
      padding: 20px 0 0 20px;
      color: #818080;
      font-weight: 600;
      font-size: 20px;
    }
  }
  .icon {
    position: absolute;
    right: 10px;
    bottom: 0px;
    color: #8176f1;
  }
}
</style>
